import request from '@u/request'

/**
 * @returns {Promise<{
 *     success: boolean,
 *     message: string,
 *     data: Object | null | Array
 * }>} 返回一个Promise对象，其解析值为查询结果
 * @param params object 查询参数
 */
export function getHomeBannerInfo(params) {
  return request(`/data/total/home/info/banner/query`, {
    method: 'GET',
    params,
  })
}

export function getHomeGraphInfo(params) {
  return request(`/data/total/home/info/graph/query`, {
    method: 'GET',
    params,
  })
}

export function getHomeSatisfactionInfo(params) {
  return request(`/data/total/home/satisfaction/query`, {
    method: 'GET',
    params,
  })
}

export function getHomeProposalInfo(params) {
  return request(`/topic/total/home/proposal/query`, {
    method: 'GET',
    params,
  })
}

export function getHomeProposalGroupInfo(params) {
  return request(`/topic/total/home/proposal/group/query`, {
    method: 'GET',
    params,
  })
}

export function getHomeTemplateInfo(params) {
  return request(`/index/total/home/query/template`, {
    method: 'GET',
    params,
  })
}

export function getHomeTaskInfo(params) {
  return request(`/index/total/home/query/task`, {
    method: 'GET',
    params,
  })
}

export function getHomeSatisfactionGraphInfo(params) {
  return request(`/topic/total/home/satisfaction/graph/query`, {
    method: 'GET',
    params,
  })
}
